<%@page import="com.entities.projecttask.actionscript.ActionScriptParserTaskSubtaskAdd"%>
<%@page import="com.entities.projecttask.list.TaskTaskListController"%>
<%@page import="com.core.utils.GlobalConstants"%>
<%@page import="com.core.ui.controller.ActionBarController"%>
<%@page import="com.core.managers.SessionManager"%>
<%@taglib prefix="sorokina" uri="/WEB-INF/Sorokina.tld"%>


<script type="text/javascript">
    function deleteTask(taskId){
        var confirmResult = confirm("Are you sure?");
        if (confirmResult){

            jQuery.post('<%=GlobalConstants.SERVLET_TASKDELETE%>
	', {
				'id' : taskId
			}, function(data) {
				location.reload();
			});

		}
	}
</script>


<%
    SessionManager.setContext(GlobalConstants.USERCONTEXT_SUBTASKSLIST);

	String objectId = request.getParameter("id");

	TaskTaskListController taskTaskListController = new TaskTaskListController();
	taskTaskListController.setTaskId(objectId);

	ActionScriptParserTaskSubtaskAdd actionScriptParserTaskSubtaskAdd = new ActionScriptParserTaskSubtaskAdd();
	actionScriptParserTaskSubtaskAdd.setTaskId(objectId);

	ActionBarController actionBarController = new ActionBarController();
	actionBarController.setActionScriptParser(actionScriptParserTaskSubtaskAdd);
%>

<div>

    <sorokina:ActionBarView datasource="<%=actionBarController %>" />

    <sorokina:TableView datasource="<%=taskTaskListController%>" delegate="<%=taskTaskListController%>" />
</div>